﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using MobileBroadbandUserBlog.MBLM.Core.Interfaces;


namespace MobileBroadbandUserBlog.MBLM.Core.MobileSoftware
{
    public class HUAWEIMobilePartner : IMobileSoftware
    {
        string _dirToLook = string.Empty;
        bool _isPresent = false;
        #region IMobileSoftware Members


        public HUAWEIMobilePartner()
        {
            string[] dirs = Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles));
            foreach (string dir in dirs)
            {
                if (Directory.Exists(dir + @"\log"))
                {
                    if (File.Exists(dir + @"\log\atrecord.txt") && File.Exists(dir + @"\log\Func_trace.txt"))
                    {
                        _isPresent = true;
                        _dirToLook = dir + @"\log";
                    }
                }
            }
        }



        public override bool IsPresent()
        {
            return _isPresent;
        }

        public override string GetName()
        {
            return "HUAWEI Mobile Partner";
        }

        public override string GetFolderToMonitor()
        {
            return _dirToLook;
        }

        public override string GetFileFilterToMonitor()
        {
            return "*.txt";
        }

        public override bool HasSolution()
        {
            return true;
        }

        public override string GetSolutionURL()
        {
            return "http://blog.mobilebroadbanduser.eu/post/2010/01/02/Stop-the-excessive-logging-in-HUAWEI-Mobile-Partner.aspx";
        }

        #endregion
    }

}
